﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;

namespace CPPEI.ETL.TESTWEB
{
    /// <summary>
    /// WebService2 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务，请取消注释以下行。 
    // [System.Web.Script.Services.ScriptService]
    public class WebService2 : System.Web.Services.WebService
    {

        
        [WebMethod]
        public Data2 HelloWorld(string p1, string[] p2)
        {
            Data2 d2 = new Data2();
            for (int index = 0; index < 10; index++)
            {
                Data2.Item item = new Data2.Item();
                item.Id = string.Format("id{0}", index);
                item.Value = index;
                d2.Items.Add(item);
            }
            return d2;
        }
    }

    public class Data2
    {
        public List<Item> Items = new List<Item>();

        public class Item
        {
            public string Id { get; set; }
            public int Value { get; set; }
        }
    }
}
